<template>
  <div class="table-show-box">
    <el-col v-for="item in dataModel" :key="item.title">
      <el-col>
        <p class="table-show-title">{{ item.title }}</p>
        <el-col :span="24" v-if="item.content">
          <el-col
            v-for="e in item.content"
            :key="e.name"
            :span="8 || e.span"
            class="text"
          >
            <el-col v-if="e.type == 'text'||!e.type">
              <span class="label">{{ e.label }}:</span>
              <span class="value">{{ e.value |formateCodeToNameByKey(e.name)}}</span>
            </el-col>
             <el-col v-if="e.type == 'img'">
              <div style="width:140px">
               <div style="float:left;"><img style="width:40px;height:40px" src="https://rmt.dogedoge.com/rmt/Sdje_r1bEm2h2NH5QqAqyMrpZnFCNmfD_x3squtUoTsiL3NsST9rEMjafk?w=212&h=130" /></div>
               <div style="float:right">
                <p style="margin:0">文件名</p> 
                <span>查看</span>
                <span>下载</span>
                </div>  
              </div> 
            </el-col>
          </el-col>
        </el-col>
        <span></span>
        <slot />
      </el-col>
      <el-col v-if="item.tableColumns">
        <h-table-list
          border
          :show-pagination="item.showPage"
          type="local"
          :data="item.tableData"
          :paginationInfo="item.paginationInfo"
          :page-sizes="[10, 20]"
          :columns="item.tableColumns"
        >
        <template slot="operate-filePath" slot-scope="scope">
          <a :href="scope.row.filePath">下载</a>
           </template>
        </h-table-list>
      </el-col>
    </el-col>
  </div>
</template>
<script>
export default {
  props: ["dataModel"],
  data() {
    return {};
  },
  created() {
    console.log(this.dataModel, "--------------");
  },
};
</script>
<style lang="scss">
.table-show-box {
  background: white;
  margin-bottom: 20px;
  padding-bottom: 20px;
  overflow: hidden;
}
.table-show-title {
  padding: 5px 0;
  border-bottom: 1px solid #999;
}
.text {
  margin: 20px 0;
  color: #999;
}
</style>